﻿using System;
using System.Runtime.Serialization;
using Blackbird.Common.Properties;

namespace Blackbird.Common.Exceptions
{
    [Serializable]
    public class SerializationException : NotSupportedException
    {
        public SerializationException()
        {
        }

        public SerializationException(string message) : base(message)
        {
        }

        public SerializationException(string message, Exception inner) : base(message, inner)
        {
        }

        protected SerializationException(
            SerializationInfo info,
            StreamingContext context)
            : base(info, context)
        {
        }

        /// <summary>
        /// Throws a new instance of this exception type with the default i18n-ed message.
        /// </summary>
        public static void Throw()
        {
            throw new SerializationException(Resources.SerializationExceptionMessage);
        }
    }
}